1use crate::co;
2use crate::decl::*;
3use crate::kernel::privs::*;
4use crate::macros::*;
5use crate::msg::*;
6use crate::ole::privs::*;
7use crate::prelude::*;
8use crate::user::privs::*;
9
10pub struct LvmApproximateViewRect {
15 pub num_items: Option<u32>,
16 pub proposed_x: Option<u16>,
17 pub proposed_y: Option<u16>,
18}
19
20impl MsgSend for LvmApproximateViewRect {
21 type RetType = SIZE;
22
23 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
24 SIZE::from(v as u32)
25 }
26
27 fn as_generic_wm(&mut self) -> Wm {
28 Wm {
29 msg_id: co::LVM::APPROXIMATEVIEWRECT.into(),
30 wparam: self.num_items.map_or(-1, |n| n as i32) as _,
31 lparam: MAKEDWORD(
32 self.proposed_x.map_or(-1, |x| x as i32) as _,
33 self.proposed_y.map_or(-1, |y| y as i32) as _,
34 ) as _,
35 }
36 }
37}
38
39pub struct LvmArrange {
44 pub arrangement: co::LVA,
45}
46
47impl MsgSend for LvmArrange {
48 type RetType = SysResult<()>;
49
50 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
51 zero_as_badargs(v).map(|_| ())
52 }
53
54 fn as_generic_wm(&mut self) -> Wm {
55 Wm {
56 msg_id: co::LVM::ARRANGE.into(),
57 wparam: self.arrangement.raw() as _,
58 lparam: 0,
59 }
60 }
61}
62
63pub_struct_msg_empty! { LvmCancelEditLabel: co::LVM::CANCELEDITLABEL.into();
64 }
66
67pub struct LvmCreateDragImage<'a> {
72 pub index: u32,
73 pub img_location: &'a mut RECT,
74}
75
76impl<'a> MsgSend for LvmCreateDragImage<'a> {
77 type RetType = SysResult<HIMAGELIST>;
78
79 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
80 zero_as_badargs(v).map(|p| unsafe { HIMAGELIST::from_ptr(p as _) })
81 }
82
83 fn as_generic_wm(&mut self) -> Wm {
84 Wm {
85 msg_id: co::LVM::CREATEDRAGIMAGE.into(),
86 wparam: self.index as _,
87 lparam: self.img_location as *mut _ as _,
88 }
89 }
90}
91
92pub struct LvmDeleteAllItems {}
97
98impl MsgSend for LvmDeleteAllItems {
99 type RetType = SysResult<()>;
100
101 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
102 zero_as_badargs(v).map(|_| ())
103 }
104
105 fn as_generic_wm(&mut self) -> Wm {
106 Wm {
107 msg_id: co::LVM::DELETEALLITEMS.into(),
108 wparam: 0,
109 lparam: 0,
110 }
111 }
112}
113
114pub struct LvmDeleteColumn {
119 pub index: u32,
120}
121
122impl MsgSend for LvmDeleteColumn {
123 type RetType = SysResult<()>;
124
125 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
126 zero_as_badargs(v).map(|_| ())
127 }
128
129 fn as_generic_wm(&mut self) -> Wm {
130 Wm {
131 msg_id: co::LVM::DELETECOLUMN.into(),
132 wparam: self.index as _,
133 lparam: 0,
134 }
135 }
136}
137
138pub struct LvmDeleteItem {
143 pub index: u32,
144}
145
146impl MsgSend for LvmDeleteItem {
147 type RetType = SysResult<()>;
148
149 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
150 zero_as_badargs(v).map(|_| ())
151 }
152
153 fn as_generic_wm(&mut self) -> Wm {
154 Wm {
155 msg_id: co::LVM::DELETEITEM.into(),
156 wparam: self.index as _,
157 lparam: 0,
158 }
159 }
160}
161
162pub struct LvmEditLabel {
167 pub index: Option<u32>,
168}
169
170impl MsgSend for LvmEditLabel {
171 type RetType = SysResult<HWND>;
172
173 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
174 zero_as_badargs(v).map(|p| unsafe { HWND::from_ptr(p as _) })
175 }
176
177 fn as_generic_wm(&mut self) -> Wm {
178 Wm {
179 msg_id: co::LVM::EDITLABEL.into(),
180 wparam: self.index.map_or(-1, |i| i as i32) as _,
181 lparam: 0,
182 }
183 }
184}
185
186pub struct LvmEnableGroupView {
191 pub enable: bool,
192}
193
194impl MsgSend for LvmEnableGroupView {
195 type RetType = SysResult<bool>;
196
197 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
198 minus1_as_badargs(v).map(|v| v != 0)
199 }
200
201 fn as_generic_wm(&mut self) -> Wm {
202 Wm {
203 msg_id: co::LVM::ENABLEGROUPVIEW.into(),
204 wparam: self.enable as _,
205 lparam: 0,
206 }
207 }
208}
209
210pub struct LvmEnsureVisible {
215 pub index: u32,
216 pub entirely_visible: bool,
217}
218
219impl MsgSend for LvmEnsureVisible {
220 type RetType = SysResult<()>;
221
222 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
223 zero_as_badargs(v).map(|_| ())
224 }
225
226 fn as_generic_wm(&mut self) -> Wm {
227 Wm {
228 msg_id: co::LVM::ENSUREVISIBLE.into(),
229 wparam: self.index as _,
230 lparam: !self.entirely_visible as _,
231 }
232 }
233}
234
235pub struct LvmFindItem<'a, 'b> {
240 pub start_index: Option<u32>,
241 pub lvfindinfo: &'b LVFINDINFO<'a>,
242}
243
244impl<'a, 'b> MsgSend for LvmFindItem<'a, 'b> {
245 type RetType = Option<u32>;
246
247 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
248 minus1_as_none(v).map(|v| v as _)
249 }
250
251 fn as_generic_wm(&mut self) -> Wm {
252 Wm {
253 msg_id: co::LVM::FINDITEM.into(),
254 wparam: self.start_index.map_or(-1, |idx| idx as i32) as _,
255 lparam: self.lvfindinfo as *const _ as _,
256 }
257 }
258}
259
260pub struct LvmGetBkColor {}
265
266impl MsgSend for LvmGetBkColor {
267 type RetType = COLORREF;
268
269 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
270 unsafe { COLORREF::from_raw(v as _) }
271 }
272
273 fn as_generic_wm(&mut self) -> Wm {
274 Wm {
275 msg_id: co::LVM::GETBKCOLOR.into(),
276 wparam: 0,
277 lparam: 0,
278 }
279 }
280}
281
282pub struct LvmGetBkImage<'a, 'b> {
287 pub lvbkimage: &'b mut LVBKIMAGE<'a>,
288}
289
290impl<'a, 'b> MsgSend for LvmGetBkImage<'a, 'b> {
291 type RetType = SysResult<()>;
292
293 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
294 zero_as_badargs(v).map(|_| ())
295 }
296
297 fn as_generic_wm(&mut self) -> Wm {
298 Wm {
299 msg_id: co::LVM::GETBKIMAGE.into(),
300 wparam: 0,
301 lparam: self.lvbkimage as *mut _ as _,
302 }
303 }
304}
305
306pub struct LvmGetCallbackMask {}
311
312impl MsgSend for LvmGetCallbackMask {
313 type RetType = co::LVIS;
314
315 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
316 unsafe { co::LVIS::from_raw(v as _) }
317 }
318
319 fn as_generic_wm(&mut self) -> Wm {
320 Wm {
321 msg_id: co::LVM::GETCALLBACKMASK.into(),
322 wparam: 0,
323 lparam: 0,
324 }
325 }
326}
327
328pub struct LvmGetColumn<'a, 'b> {
333 pub index: u32,
334 pub lvcolumn: &'b mut LVCOLUMN<'a>,
335}
336
337impl<'a, 'b> MsgSend for LvmGetColumn<'a, 'b> {
338 type RetType = SysResult<()>;
339
340 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
341 zero_as_badargs(v).map(|_| ())
342 }
343
344 fn as_generic_wm(&mut self) -> Wm {
345 Wm {
346 msg_id: co::LVM::GETCOLUMN.into(),
347 wparam: self.index as _,
348 lparam: self.lvcolumn as *mut _ as _,
349 }
350 }
351}
352
353pub struct LvmGetColumnOrderArray<'a> {
358 pub indexes: &'a mut Vec<u32>,
359}
360
361impl<'a> MsgSend for LvmGetColumnOrderArray<'a> {
362 type RetType = SysResult<()>;
363
364 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
365 zero_as_badargs(v).map(|_| ())
366 }
367
368 fn as_generic_wm(&mut self) -> Wm {
369 Wm {
370 msg_id: co::LVM::GETCOLUMNORDERARRAY.into(),
371 wparam: self.indexes.len() as _,
372 lparam: self.indexes.as_mut_ptr() as _,
373 }
374 }
375}
376
377pub struct LvmGetColumnWidth {
382 pub index: u32,
383}
384
385impl MsgSend for LvmGetColumnWidth {
386 type RetType = SysResult<u32>;
387
388 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
389 minus1_as_badargs(v).map(|v| v as _)
390 }
391
392 fn as_generic_wm(&mut self) -> Wm {
393 Wm {
394 msg_id: co::LVM::GETCOLUMNWIDTH.into(),
395 wparam: self.index as _,
396 lparam: 0,
397 }
398 }
399}
400
401pub struct LvmGetCountPerPage {}
406
407impl MsgSend for LvmGetCountPerPage {
408 type RetType = u32;
409
410 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
411 v as _
412 }
413
414 fn as_generic_wm(&mut self) -> Wm {
415 Wm {
416 msg_id: co::LVM::GETCOUNTPERPAGE.into(),
417 wparam: 0,
418 lparam: 0,
419 }
420 }
421}
422
423pub struct LvmGetEditControl {}
428
429impl MsgSend for LvmGetEditControl {
430 type RetType = Option<HWND>;
431
432 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
433 zero_as_none(v).map(|p| unsafe { HWND::from_ptr(p as _) })
434 }
435
436 fn as_generic_wm(&mut self) -> Wm {
437 Wm {
438 msg_id: co::LVM::GETEDITCONTROL.into(),
439 wparam: 0,
440 lparam: 0,
441 }
442 }
443}
444
445pub struct LvmGetEmptyText<'a> {
450 pub text: &'a mut WString,
451}
452
453impl<'a> MsgSend for LvmGetEmptyText<'a> {
454 type RetType = SysResult<()>;
455
456 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
457 zero_as_badargs(v).map(|_| ())
458 }
459
460 fn as_generic_wm(&mut self) -> Wm {
461 Wm {
462 msg_id: co::LVM::GETEMPTYTEXT.into(),
463 wparam: self.text.buf_len(),
464 lparam: unsafe { self.text.as_mut_ptr() } as _,
465 }
466 }
467}
468
469pub struct LvmGetExtendedListViewStyle {}
474
475impl MsgSend for LvmGetExtendedListViewStyle {
476 type RetType = co::LVS_EX;
477
478 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
479 unsafe { co::LVS_EX::from_raw(v as _) }
480 }
481
482 fn as_generic_wm(&mut self) -> Wm {
483 Wm {
484 msg_id: co::LVM::GETEXTENDEDLISTVIEWSTYLE.into(),
485 wparam: 0,
486 lparam: 0,
487 }
488 }
489}
490
491pub struct LvmGetFocusedGroup {}
496
497impl MsgSend for LvmGetFocusedGroup {
498 type RetType = Option<u32>;
499
500 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
501 minus1_as_none(v).map(|v| v as _)
502 }
503
504 fn as_generic_wm(&mut self) -> Wm {
505 Wm {
506 msg_id: co::LVM::GETFOCUSEDGROUP.into(),
507 wparam: 0,
508 lparam: 0,
509 }
510 }
511}
512
513pub struct LvmGetFooterInfo<'a, 'b> {
518 pub info: &'b mut LVFOOTERINFO<'a>,
519}
520
521impl<'a, 'b> MsgSend for LvmGetFooterInfo<'a, 'b> {
522 type RetType = ();
523
524 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
525 ()
526 }
527
528 fn as_generic_wm(&mut self) -> Wm {
529 Wm {
530 msg_id: co::LVM::GETFOOTERINFO.into(),
531 wparam: 0,
532 lparam: self.info as *mut _ as _,
533 }
534 }
535}
536
537pub struct LvmGetFooterItem<'a, 'b> {
542 pub index: u32,
543 pub info: &'b mut LVFOOTERITEM<'a>,
544}
545
546impl<'a, 'b> MsgSend for LvmGetFooterItem<'a, 'b> {
547 type RetType = SysResult<()>;
548
549 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
550 zero_as_badargs(v).map(|_| ())
551 }
552
553 fn as_generic_wm(&mut self) -> Wm {
554 Wm {
555 msg_id: co::LVM::GETFOOTERITEM.into(),
556 wparam: self.index as _,
557 lparam: self.info as *mut _ as _,
558 }
559 }
560}
561
562pub struct LvmGetFooterItemRect<'a> {
567 pub index: u32,
568 pub rect: &'a mut RECT,
569}
570
571impl<'a> MsgSend for LvmGetFooterItemRect<'a> {
572 type RetType = SysResult<()>;
573
574 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
575 zero_as_badargs(v).map(|_| ())
576 }
577
578 fn as_generic_wm(&mut self) -> Wm {
579 Wm {
580 msg_id: co::LVM::GETFOOTERITEMRECT.into(),
581 wparam: self.index as _,
582 lparam: self.rect as *mut _ as _,
583 }
584 }
585}
586
587pub struct LvmGetFooterRect<'a> {
592 pub rect: &'a mut RECT,
593}
594
595impl<'a> MsgSend for LvmGetFooterRect<'a> {
596 type RetType = SysResult<()>;
597
598 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
599 zero_as_badargs(v).map(|_| ())
600 }
601
602 fn as_generic_wm(&mut self) -> Wm {
603 Wm {
604 msg_id: co::LVM::GETFOOTERRECT.into(),
605 wparam: 0,
606 lparam: self.rect as *mut _ as _,
607 }
608 }
609}
610
611pub struct LvmGetGroupCount {}
616
617impl MsgSend for LvmGetGroupCount {
618 type RetType = u32;
619
620 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
621 v as _
622 }
623
624 fn as_generic_wm(&mut self) -> Wm {
625 Wm {
626 msg_id: co::LVM::GETGROUPCOUNT.into(),
627 wparam: 0,
628 lparam: 0,
629 }
630 }
631}
632
633pub struct LvmGetGroupInfo<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> {
638 pub id: u32,
639 pub info: &'h mut LVGROUP<'a, 'b, 'c, 'd, 'e, 'f, 'g>,
640}
641
642impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> MsgSend for LvmGetGroupInfo<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> {
643 type RetType = SysResult<u32>;
644
645 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
646 minus1_as_badargs(v).map(|v| v as _)
647 }
648
649 fn as_generic_wm(&mut self) -> Wm {
650 Wm {
651 msg_id: co::LVM::GETGROUPINFO.into(),
652 wparam: self.id as _,
653 lparam: self.info as *mut _ as _,
654 }
655 }
656}
657
658pub struct LvmGetGroupInfoByIndex<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> {
663 pub index: u32,
664 pub info: &'h mut LVGROUP<'a, 'b, 'c, 'd, 'e, 'f, 'g>,
665}
666
667impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> MsgSend
668 for LvmGetGroupInfoByIndex<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h>
669{
670 type RetType = SysResult<()>;
671
672 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
673 zero_as_badargs(v).map(|_| ())
674 }
675
676 fn as_generic_wm(&mut self) -> Wm {
677 Wm {
678 msg_id: co::LVM::GETGROUPINFOBYINDEX.into(),
679 wparam: self.index as _,
680 lparam: self.info as *mut _ as _,
681 }
682 }
683}
684
685pub struct LvmGetGroupMetrics<'a> {
690 pub info: &'a mut LVGROUPMETRICS,
691}
692
693impl<'a> MsgSend for LvmGetGroupMetrics<'a> {
694 type RetType = ();
695
696 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
697 ()
698 }
699
700 fn as_generic_wm(&mut self) -> Wm {
701 Wm {
702 msg_id: co::LVM::GETGROUPMETRICS.into(),
703 wparam: 0,
704 lparam: self.info as *mut _ as _,
705 }
706 }
707}
708
709pub struct LvmGetGroupRect<'a> {
714 pub id: u32,
715 pub flags: co::LVGGR,
716 pub rect: &'a mut RECT,
717}
718
719impl<'a> MsgSend for LvmGetGroupRect<'a> {
720 type RetType = SysResult<()>;
721
722 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
723 zero_as_badargs(v).map(|_| ())
724 }
725
726 fn as_generic_wm(&mut self) -> Wm {
727 self.rect.top = self.flags.raw();
728
729 Wm {
730 msg_id: co::LVM::GETGROUPRECT.into(),
731 wparam: self.id as _,
732 lparam: self.rect as *mut _ as _,
733 }
734 }
735}
736
737pub struct LvmGetGroupState {
742 pub id: u32,
743 pub mask: co::LVGS,
744}
745
746impl MsgSend for LvmGetGroupState {
747 type RetType = co::LVGS;
748
749 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
750 unsafe { co::LVGS::from_raw(v as _) }
751 }
752
753 fn as_generic_wm(&mut self) -> Wm {
754 Wm {
755 msg_id: co::LVM::GETGROUPSTATE.into(),
756 wparam: self.id as _,
757 lparam: self.mask.raw() as _,
758 }
759 }
760}
761
762pub struct LvmGetHeader {}
767
768impl MsgSend for LvmGetHeader {
769 type RetType = SysResult<HWND>;
770
771 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
772 zero_as_badargs(v).map(|p| unsafe { HWND::from_ptr(p as _) })
773 }
774
775 fn as_generic_wm(&mut self) -> Wm {
776 Wm {
777 msg_id: co::LVM::GETHEADER.into(),
778 wparam: 0,
779 lparam: 0,
780 }
781 }
782}
783
784pub struct LvmGetHotCursor {}
789
790impl MsgSend for LvmGetHotCursor {
791 type RetType = SysResult<HCURSOR>;
792
793 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
794 zero_as_badargs(v).map(|p| unsafe { HCURSOR::from_ptr(p as _) })
795 }
796
797 fn as_generic_wm(&mut self) -> Wm {
798 Wm {
799 msg_id: co::LVM::GETHOTCURSOR.into(),
800 wparam: 0,
801 lparam: 0,
802 }
803 }
804}
805
806pub struct LvmGetHotItem {}
811
812impl MsgSend for LvmGetHotItem {
813 type RetType = Option<u32>;
814
815 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
816 zero_as_none(v).map(|idx| idx as _)
817 }
818
819 fn as_generic_wm(&mut self) -> Wm {
820 Wm {
821 msg_id: co::LVM::GETHOTITEM.into(),
822 wparam: 0,
823 lparam: 0,
824 }
825 }
826}
827
828pub struct LvmGetHoverTime {}
833
834impl MsgSend for LvmGetHoverTime {
835 type RetType = Option<u32>;
836
837 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
838 zero_as_none(v).map(|idx| idx as _)
839 }
840
841 fn as_generic_wm(&mut self) -> Wm {
842 Wm {
843 msg_id: co::LVM::GETHOVERTIME.into(),
844 wparam: 0,
845 lparam: 0,
846 }
847 }
848}
849
850pub struct LvmGetImageList {
855 pub kind: co::LVSIL,
856}
857
858impl MsgSend for LvmGetImageList {
859 type RetType = Option<HIMAGELIST>;
860
861 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
862 zero_as_none(v).map(|p| unsafe { HIMAGELIST::from_ptr(p as _) })
863 }
864
865 fn as_generic_wm(&mut self) -> Wm {
866 Wm {
867 msg_id: co::LVM::GETIMAGELIST.into(),
868 wparam: self.kind.raw() as _,
869 lparam: 0,
870 }
871 }
872}
873
874pub struct LvmGetInsertMark<'a> {
879 pub info: &'a mut LVINSERTMARK,
880}
881
882impl<'a> MsgSend for LvmGetInsertMark<'a> {
883 type RetType = SysResult<()>;
884
885 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
886 zero_as_badargs(v).map(|_| ())
887 }
888
889 fn as_generic_wm(&mut self) -> Wm {
890 Wm {
891 msg_id: co::LVM::GETINSERTMARK.into(),
892 wparam: 0,
893 lparam: self.info as *mut _ as _,
894 }
895 }
896}
897
898pub struct LvmGetInsertMarkColor {}
903
904impl MsgSend for LvmGetInsertMarkColor {
905 type RetType = COLORREF;
906
907 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
908 unsafe { COLORREF::from_raw(v as _) }
909 }
910
911 fn as_generic_wm(&mut self) -> Wm {
912 Wm {
913 msg_id: co::LVM::GETINSERTMARKCOLOR.into(),
914 wparam: 0,
915 lparam: 0,
916 }
917 }
918}
919
920pub struct LvmGetInsertMarkRect<'a> {
925 pub rect: &'a mut RECT,
926}
927
928impl<'a> MsgSend for LvmGetInsertMarkRect<'a> {
929 type RetType = bool;
930
931 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
932 v != 0
933 }
934
935 fn as_generic_wm(&mut self) -> Wm {
936 Wm {
937 msg_id: co::LVM::GETINSERTMARKRECT.into(),
938 wparam: 0,
939 lparam: self.rect as *mut _ as _,
940 }
941 }
942}
943
944pub struct LvmGetISearchString<'a> {
949 pub buffer: Option<&'a mut WString>,
950}
951
952impl<'a> MsgSend for LvmGetISearchString<'a> {
953 type RetType = Option<u32>;
954
955 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
956 zero_as_none(v).map(|c| c as _)
957 }
958
959 fn as_generic_wm(&mut self) -> Wm {
960 Wm {
961 msg_id: co::LVM::GETISEARCHSTRING.into(),
962 wparam: 0,
963 lparam: self
964 .buffer
965 .as_mut()
966 .map_or(0, |buf| unsafe { buf.as_mut_ptr() } as _),
967 }
968 }
969}
970
971pub struct LvmGetItem<'a, 'b> {
976 pub lvitem: &'b mut LVITEM<'a>,
977}
978
979impl<'a, 'b> MsgSend for LvmGetItem<'a, 'b> {
980 type RetType = SysResult<()>;
981
982 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
983 zero_as_badargs(v).map(|_| ())
984 }
985
986 fn as_generic_wm(&mut self) -> Wm {
987 Wm {
988 msg_id: co::LVM::GETITEM.into(),
989 wparam: 0,
990 lparam: self.lvitem as *mut _ as _,
991 }
992 }
993}
994
995pub struct LvmGetItemCount {}
1000
1001impl MsgSend for LvmGetItemCount {
1002 type RetType = u32;
1003
1004 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1005 v as _
1006 }
1007
1008 fn as_generic_wm(&mut self) -> Wm {
1009 Wm {
1010 msg_id: co::LVM::GETITEMCOUNT.into(),
1011 wparam: 0,
1012 lparam: 0,
1013 }
1014 }
1015}
1016
1017pub struct LvmGetItemIndexRect<'a, 'b> {
1022 pub lvitemindex: &'a LVITEMINDEX,
1023 pub rect: &'b mut RECT,
1024 pub index: u32,
1025 pub portion: co::LVIR,
1026}
1027
1028impl<'a, 'b> MsgSend for LvmGetItemIndexRect<'a, 'b> {
1029 type RetType = SysResult<()>;
1030
1031 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1032 zero_as_badargs(v).map(|_| ())
1033 }
1034
1035 fn as_generic_wm(&mut self) -> Wm {
1036 self.rect.top = self.index as _;
1037 self.rect.left = self.portion.raw() as _;
1038
1039 Wm {
1040 msg_id: co::LVM::GETITEMINDEXRECT.into(),
1041 wparam: self.lvitemindex as *const _ as _,
1042 lparam: self.rect as *mut _ as _,
1043 }
1044 }
1045}
1046
1047pub struct LvmGetItemPosition<'a> {
1052 pub index: u32,
1053 pub pos: &'a mut POINT,
1054}
1055
1056impl<'a> MsgSend for LvmGetItemPosition<'a> {
1057 type RetType = SysResult<()>;
1058
1059 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1060 zero_as_badargs(v).map(|_| ())
1061 }
1062
1063 fn as_generic_wm(&mut self) -> Wm {
1064 Wm {
1065 msg_id: co::LVM::GETITEMPOSITION.into(),
1066 wparam: self.index as _,
1067 lparam: self.pos as *mut _ as _,
1068 }
1069 }
1070}
1071
1072pub struct LvmGetItemRect<'a> {
1077 pub index: u32,
1078 pub rect: &'a mut RECT,
1079 pub portion: co::LVIR,
1080}
1081
1082impl<'a> MsgSend for LvmGetItemRect<'a> {
1083 type RetType = SysResult<()>;
1084
1085 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1086 zero_as_badargs(v).map(|_| ())
1087 }
1088
1089 fn as_generic_wm(&mut self) -> Wm {
1090 self.rect.left = self.portion.raw() as _;
1091
1092 Wm {
1093 msg_id: co::LVM::GETITEMRECT.into(),
1094 wparam: self.index as _,
1095 lparam: self.rect as *mut _ as _,
1096 }
1097 }
1098}
1099
1100pub struct LvmGetItemSpacing {
1105 pub is_small_icon_view: bool,
1106}
1107
1108impl MsgSend for LvmGetItemSpacing {
1109 type RetType = SIZE;
1110
1111 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1112 SIZE::from(v as u32)
1113 }
1114
1115 fn as_generic_wm(&mut self) -> Wm {
1116 Wm {
1117 msg_id: co::LVM::GETITEMSTATE.into(),
1118 wparam: self.is_small_icon_view as _,
1119 lparam: 0,
1120 }
1121 }
1122}
1123
1124pub struct LvmGetItemState {
1129 pub index: u32,
1130 pub mask: co::LVIS,
1131}
1132
1133impl MsgSend for LvmGetItemState {
1134 type RetType = co::LVIS;
1135
1136 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1137 unsafe { co::LVIS::from_raw(v as _) }
1138 }
1139
1140 fn as_generic_wm(&mut self) -> Wm {
1141 Wm {
1142 msg_id: co::LVM::GETITEMSTATE.into(),
1143 wparam: self.index as _,
1144 lparam: self.mask.raw() as _,
1145 }
1146 }
1147}
1148
1149pub struct LvmGetItemText<'a, 'b> {
1154 pub index: u32,
1155 pub lvitem: &'b mut LVITEM<'a>,
1156}
1157
1158impl<'a, 'b> MsgSend for LvmGetItemText<'a, 'b> {
1159 type RetType = u32;
1160
1161 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1162 v as _
1163 }
1164
1165 fn as_generic_wm(&mut self) -> Wm {
1166 Wm {
1167 msg_id: co::LVM::GETITEMTEXT.into(),
1168 wparam: self.index as _,
1169 lparam: self.lvitem as *mut _ as _,
1170 }
1171 }
1172}
1173
1174pub struct LvmGetNextItem {
1179 pub initial_index: Option<u32>,
1180 pub relationship: co::LVNI,
1181}
1182
1183impl MsgSend for LvmGetNextItem {
1184 type RetType = Option<u32>;
1185
1186 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1187 minus1_as_none(v).map(|v| v as _)
1188 }
1189
1190 fn as_generic_wm(&mut self) -> Wm {
1191 Wm {
1192 msg_id: co::LVM::GETNEXTITEM.into(),
1193 wparam: self.initial_index.map_or(-1, |idx| idx as i32) as _,
1194 lparam: self.relationship.raw() as _,
1195 }
1196 }
1197}
1198
1199pub struct LvmGetNextItemIndex<'a> {
1204 pub initial_item: &'a mut LVITEMINDEX,
1205 pub relationship: co::LVNI,
1206}
1207
1208impl<'a> MsgSend for LvmGetNextItemIndex<'a> {
1209 type RetType = SysResult<()>;
1210
1211 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1212 zero_as_badargs(v).map(|_| ())
1213 }
1214
1215 fn as_generic_wm(&mut self) -> Wm {
1216 Wm {
1217 msg_id: co::LVM::GETNEXTITEMINDEX.into(),
1218 wparam: self.initial_item as *mut _ as _,
1219 lparam: self.relationship.raw() as _,
1220 }
1221 }
1222}
1223
1224pub struct LvmGetNumberOfWorkAreas<'a> {
1229 pub num: &'a mut u32,
1230}
1231
1232impl<'a> MsgSend for LvmGetNumberOfWorkAreas<'a> {
1233 type RetType = ();
1234
1235 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
1236 ()
1237 }
1238
1239 fn as_generic_wm(&mut self) -> Wm {
1240 Wm {
1241 msg_id: co::LVM::GETNUMBEROFWORKAREAS.into(),
1242 wparam: 0,
1243 lparam: self.num as *mut _ as _,
1244 }
1245 }
1246}
1247
1248pub struct LvmGetOrigin<'a> {
1253 pub origin: &'a mut POINT,
1254}
1255
1256impl<'a> MsgSend for LvmGetOrigin<'a> {
1257 type RetType = bool;
1258
1259 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1260 v != 0
1261 }
1262
1263 fn as_generic_wm(&mut self) -> Wm {
1264 Wm {
1265 msg_id: co::LVM::GETORIGIN.into(),
1266 wparam: 0,
1267 lparam: self.origin as *mut _ as _,
1268 }
1269 }
1270}
1271
1272pub struct LvmGetOutlineColor {}
1277
1278impl MsgSend for LvmGetOutlineColor {
1279 type RetType = COLORREF;
1280
1281 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1282 unsafe { COLORREF::from_raw(v as _) }
1283 }
1284
1285 fn as_generic_wm(&mut self) -> Wm {
1286 Wm {
1287 msg_id: co::LVM::GETOUTLINECOLOR.into(),
1288 wparam: 0,
1289 lparam: 0,
1290 }
1291 }
1292}
1293
1294pub struct LvmGetSelectedColumn {}
1299
1300impl MsgSend for LvmGetSelectedColumn {
1301 type RetType = Option<u32>;
1302
1303 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1304 minus1_as_none(v).map(|v| v as _)
1305 }
1306
1307 fn as_generic_wm(&mut self) -> Wm {
1308 Wm {
1309 msg_id: co::LVM::GETSELECTEDCOLUMN.into(),
1310 wparam: 0,
1311 lparam: 0,
1312 }
1313 }
1314}
1315
1316pub struct LvmGetSelectedCount {}
1321
1322impl MsgSend for LvmGetSelectedCount {
1323 type RetType = u32;
1324
1325 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1326 v as _
1327 }
1328
1329 fn as_generic_wm(&mut self) -> Wm {
1330 Wm {
1331 msg_id: co::LVM::GETSELECTEDCOUNT.into(),
1332 wparam: 0,
1333 lparam: 0,
1334 }
1335 }
1336}
1337
1338pub struct LvmGetSelectionMark {}
1343
1344impl MsgSend for LvmGetSelectionMark {
1345 type RetType = Option<u32>;
1346
1347 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1348 minus1_as_none(v).map(|v| v as _)
1349 }
1350
1351 fn as_generic_wm(&mut self) -> Wm {
1352 Wm {
1353 msg_id: co::LVM::GETSELECTIONMARK.into(),
1354 wparam: 0,
1355 lparam: 0,
1356 }
1357 }
1358}
1359
1360pub struct LvmGetStringWidth {
1365 pub text: WString,
1366}
1367
1368impl MsgSend for LvmGetStringWidth {
1369 type RetType = SysResult<u32>;
1370
1371 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1372 zero_as_badargs(v).map(|len| len as _)
1373 }
1374
1375 fn as_generic_wm(&mut self) -> Wm {
1376 Wm {
1377 msg_id: co::LVM::GETSTRINGWIDTH.into(),
1378 wparam: 0,
1379 lparam: self.text.as_ptr() as _,
1380 }
1381 }
1382}
1383
1384pub struct LvmGetSubItemRect<'a> {
1389 pub item_index: u32,
1390 pub subitem_index: u32,
1391 pub rect: &'a mut RECT,
1392 pub portion: co::LVIR,
1393}
1394
1395impl<'a> MsgSend for LvmGetSubItemRect<'a> {
1396 type RetType = SysResult<()>;
1397
1398 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1399 zero_as_badargs(v).map(|_| ())
1400 }
1401
1402 fn as_generic_wm(&mut self) -> Wm {
1403 self.rect.left = self.portion.raw() as _;
1404 self.rect.top = self.subitem_index as _;
1405
1406 Wm {
1407 msg_id: co::LVM::GETSUBITEMRECT.into(),
1408 wparam: self.item_index as _,
1409 lparam: self.rect as *mut _ as _,
1410 }
1411 }
1412}
1413
1414pub struct LvmGetTextBkColor {}
1419
1420impl MsgSend for LvmGetTextBkColor {
1421 type RetType = COLORREF;
1422
1423 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1424 unsafe { COLORREF::from_raw(v as _) }
1425 }
1426
1427 fn as_generic_wm(&mut self) -> Wm {
1428 Wm {
1429 msg_id: co::LVM::GETTEXTBKCOLOR.into(),
1430 wparam: 0,
1431 lparam: 0,
1432 }
1433 }
1434}
1435
1436pub struct LvmGetTextColor {}
1441
1442impl MsgSend for LvmGetTextColor {
1443 type RetType = COLORREF;
1444
1445 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1446 unsafe { COLORREF::from_raw(v as _) }
1447 }
1448
1449 fn as_generic_wm(&mut self) -> Wm {
1450 Wm {
1451 msg_id: co::LVM::GETTEXTCOLOR.into(),
1452 wparam: 0,
1453 lparam: 0,
1454 }
1455 }
1456}
1457
1458pub struct LvmGetTileInfo<'a, 'b> {
1463 pub info: &'b mut LVTILEINFO<'a>,
1464}
1465
1466impl<'a, 'b> MsgSend for LvmGetTileInfo<'a, 'b> {
1467 type RetType = ();
1468
1469 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
1470 ()
1471 }
1472
1473 fn as_generic_wm(&mut self) -> Wm {
1474 Wm {
1475 msg_id: co::LVM::GETTILEINFO.into(),
1476 wparam: 0,
1477 lparam: self.info as *mut _ as _,
1478 }
1479 }
1480}
1481
1482pub struct LvmGetTileViewInfo<'a> {
1487 pub info: &'a mut LVTILEVIEWINFO,
1488}
1489
1490impl<'a> MsgSend for LvmGetTileViewInfo<'a> {
1491 type RetType = ();
1492
1493 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
1494 ()
1495 }
1496
1497 fn as_generic_wm(&mut self) -> Wm {
1498 Wm {
1499 msg_id: co::LVM::GETTILEVIEWINFO.into(),
1500 wparam: 0,
1501 lparam: self.info as *mut _ as _,
1502 }
1503 }
1504}
1505
1506pub struct LvmGetTooltips {}
1511
1512impl MsgSend for LvmGetTooltips {
1513 type RetType = Option<HWND>;
1514
1515 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1516 zero_as_none(v).map(|p| unsafe { HWND::from_ptr(p as _) })
1517 }
1518
1519 fn as_generic_wm(&mut self) -> Wm {
1520 Wm {
1521 msg_id: co::LVM::GETTOOLTIPS.into(),
1522 wparam: 0,
1523 lparam: 0,
1524 }
1525 }
1526}
1527
1528pub struct LvmGetTopIndex {}
1536
1537impl MsgSend for LvmGetTopIndex {
1538 type RetType = u32;
1539
1540 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1541 v as _
1542 }
1543
1544 fn as_generic_wm(&mut self) -> Wm {
1545 Wm {
1546 msg_id: co::LVM::GETTOPINDEX.into(),
1547 wparam: 0,
1548 lparam: 0,
1549 }
1550 }
1551}
1552
1553pub struct LvmGetUnicodeFormat {}
1558
1559impl MsgSend for LvmGetUnicodeFormat {
1560 type RetType = bool;
1561
1562 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1563 v != 0
1564 }
1565
1566 fn as_generic_wm(&mut self) -> Wm {
1567 Wm {
1568 msg_id: co::LVM::GETUNICODEFORMAT.into(),
1569 wparam: 0,
1570 lparam: 0,
1571 }
1572 }
1573}
1574
1575pub struct LvmGetView {}
1580
1581impl MsgSend for LvmGetView {
1582 type RetType = co::LV_VIEW;
1583
1584 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1585 unsafe { co::LV_VIEW::from_raw(v as _) }
1586 }
1587
1588 fn as_generic_wm(&mut self) -> Wm {
1589 Wm {
1590 msg_id: co::LVM::GETVIEW.into(),
1591 wparam: 0,
1592 lparam: 0,
1593 }
1594 }
1595}
1596
1597pub struct LvmGetViewRect<'a> {
1602 pub rect: &'a mut RECT,
1603}
1604
1605impl<'a> MsgSend for LvmGetViewRect<'a> {
1606 type RetType = SysResult<()>;
1607
1608 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1609 zero_as_badargs(v).map(|_| ())
1610 }
1611
1612 fn as_generic_wm(&mut self) -> Wm {
1613 Wm {
1614 msg_id: co::LVM::GETVIEWRECT.into(),
1615 wparam: 0,
1616 lparam: self.rect as *mut _ as _,
1617 }
1618 }
1619}
1620
1621pub struct LvmGetWorkAreas<'a> {
1626 pub rects: &'a mut [RECT],
1627}
1628
1629impl<'a> MsgSend for LvmGetWorkAreas<'a> {
1630 type RetType = ();
1631
1632 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
1633 ()
1634 }
1635
1636 fn as_generic_wm(&mut self) -> Wm {
1637 Wm {
1638 msg_id: co::LVM::GETWORKAREAS.into(),
1639 wparam: self.rects.len() as _,
1640 lparam: self.rects.as_mut_ptr() as _,
1641 }
1642 }
1643}
1644
1645pub struct LvmHasGroup {
1650 pub id: u32,
1651}
1652
1653impl MsgSend for LvmHasGroup {
1654 type RetType = bool;
1655
1656 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1657 v != 0
1658 }
1659
1660 fn as_generic_wm(&mut self) -> Wm {
1661 Wm {
1662 msg_id: co::LVM::HASGROUP.into(),
1663 wparam: self.id as _,
1664 lparam: 0,
1665 }
1666 }
1667}
1668
1669pub struct LvmHitTest<'a> {
1674 pub info: &'a mut LVHITTESTINFO,
1675}
1676
1677impl<'a> MsgSend for LvmHitTest<'a> {
1678 type RetType = Option<u32>;
1679
1680 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1681 minus1_as_none(v).map(|v| v as _)
1682 }
1683
1684 fn as_generic_wm(&mut self) -> Wm {
1685 Wm {
1686 msg_id: co::LVM::HITTEST.into(),
1687 wparam: -1 as _,
1688 lparam: self.info as *mut _ as _,
1689 }
1690 }
1691}
1692
1693pub struct LvmInsertColumn<'a, 'b> {
1698 pub index: u32,
1699 pub column: &'b LVCOLUMN<'a>,
1700}
1701
1702impl<'a, 'b> MsgSend for LvmInsertColumn<'a, 'b> {
1703 type RetType = SysResult<u32>;
1704
1705 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1706 minus1_as_badargs(v).map(|v| v as _)
1707 }
1708
1709 fn as_generic_wm(&mut self) -> Wm {
1710 Wm {
1711 msg_id: co::LVM::INSERTCOLUMN.into(),
1712 wparam: self.index as _,
1713 lparam: self.column as *const _ as _,
1714 }
1715 }
1716}
1717
1718pub struct LvmInsertGroup<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> {
1723 pub group: &'h LVGROUP<'a, 'b, 'c, 'd, 'e, 'f, 'g>,
1724}
1725
1726impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> MsgSend for LvmInsertGroup<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> {
1727 type RetType = SysResult<u32>;
1728
1729 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1730 minus1_as_badargs(v).map(|v| v as _)
1731 }
1732
1733 fn as_generic_wm(&mut self) -> Wm {
1734 Wm {
1735 msg_id: co::LVM::INSERTGROUP.into(),
1736 wparam: 0,
1737 lparam: self.group as *const _ as _,
1738 }
1739 }
1740}
1741
1742pub struct LvmInsertGroupSorted<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> {
1747 pub group: &'h LVINSERTGROUPSORTED<'a, 'b, 'c, 'd, 'e, 'f, 'g>,
1748}
1749
1750impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> MsgSend
1751 for LvmInsertGroupSorted<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h>
1752{
1753 type RetType = ();
1754
1755 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
1756 ()
1757 }
1758
1759 fn as_generic_wm(&mut self) -> Wm {
1760 Wm {
1761 msg_id: co::LVM::INSERTGROUPSORTED.into(),
1762 wparam: 0,
1763 lparam: self.group as *const _ as _,
1764 }
1765 }
1766}
1767
1768pub struct LvmInsertItem<'a, 'b> {
1773 pub item: &'b LVITEM<'a>,
1774}
1775
1776impl<'a, 'b> MsgSend for LvmInsertItem<'a, 'b> {
1777 type RetType = SysResult<u32>;
1778
1779 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1780 minus1_as_badargs(v).map(|v| v as _)
1781 }
1782
1783 fn as_generic_wm(&mut self) -> Wm {
1784 Wm {
1785 msg_id: co::LVM::INSERTITEM.into(),
1786 wparam: 0,
1787 lparam: self.item as *const _ as _,
1788 }
1789 }
1790}
1791
1792pub struct LvmInsertMarkHitTest<'a> {
1797 pub point: POINT,
1798 pub insert_mark: &'a LVINSERTMARK,
1799}
1800
1801impl<'a, 'b> MsgSend for LvmInsertMarkHitTest<'a> {
1802 type RetType = SysResult<()>;
1803
1804 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1805 zero_as_badargs(v).map(|_| ())
1806 }
1807
1808 fn as_generic_wm(&mut self) -> Wm {
1809 Wm {
1810 msg_id: co::LVM::INSERTMARKHITTEST.into(),
1811 wparam: &self.point as *const _ as _,
1812 lparam: self.insert_mark as *const _ as _,
1813 }
1814 }
1815}
1816
1817pub struct LvmIsGroupViewEnabled {}
1822
1823impl MsgSend for LvmIsGroupViewEnabled {
1824 type RetType = bool;
1825
1826 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1827 v != 0
1828 }
1829
1830 fn as_generic_wm(&mut self) -> Wm {
1831 Wm {
1832 msg_id: co::LVM::ISGROUPVIEWENABLED.into(),
1833 wparam: 0,
1834 lparam: 0,
1835 }
1836 }
1837}
1838
1839pub struct LvmIsItemVisible {
1844 pub index: u32,
1845}
1846
1847impl MsgSend for LvmIsItemVisible {
1848 type RetType = bool;
1849
1850 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1851 v != 0
1852 }
1853
1854 fn as_generic_wm(&mut self) -> Wm {
1855 Wm {
1856 msg_id: co::LVM::ISITEMVISIBLE.into(),
1857 wparam: self.index as _,
1858 lparam: 0,
1859 }
1860 }
1861}
1862
1863pub struct LvmMapIdToIndex {
1868 pub id: u32,
1869}
1870
1871impl MsgSend for LvmMapIdToIndex {
1872 type RetType = Option<u32>;
1873
1874 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1875 minus1_as_none(v).map(|v| v as _)
1876 }
1877
1878 fn as_generic_wm(&mut self) -> Wm {
1879 Wm {
1880 msg_id: co::LVM::MAPIDTOINDEX.into(),
1881 wparam: self.id as _,
1882 lparam: 0,
1883 }
1884 }
1885}
1886
1887pub struct LvmMapIndexToId {
1892 pub index: u32,
1893}
1894
1895impl MsgSend for LvmMapIndexToId {
1896 type RetType = Option<u32>;
1897
1898 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1899 minus1_as_none(v).map(|v| v as _)
1900 }
1901
1902 fn as_generic_wm(&mut self) -> Wm {
1903 Wm {
1904 msg_id: co::LVM::MAPINDEXTOID.into(),
1905 wparam: self.index as _,
1906 lparam: 0,
1907 }
1908 }
1909}
1910
1911pub struct LvmRedrawItems {
1916 pub first_index: u32,
1917 pub last_index: u32,
1918}
1919
1920impl MsgSend for LvmRedrawItems {
1921 type RetType = SysResult<()>;
1922
1923 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1924 zero_as_badargs(v).map(|_| ())
1925 }
1926
1927 fn as_generic_wm(&mut self) -> Wm {
1928 Wm {
1929 msg_id: co::LVM::REDRAWITEMS.into(),
1930 wparam: self.first_index as _,
1931 lparam: self.last_index as _,
1932 }
1933 }
1934}
1935
1936pub_struct_msg_empty! { LvmRemoveAllGroups: co::LVM::REMOVEALLGROUPS.into();
1937 }
1942
1943pub struct LvmRemoveGroup {
1948 pub id: u32,
1949}
1950
1951impl MsgSend for LvmRemoveGroup {
1952 type RetType = SysResult<u32>;
1953
1954 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1955 zero_as_badargs(v).map(|id| id as _)
1956 }
1957
1958 fn as_generic_wm(&mut self) -> Wm {
1959 Wm {
1960 msg_id: co::LVM::REMOVEGROUP.into(),
1961 wparam: self.id as _,
1962 lparam: 0,
1963 }
1964 }
1965}
1966
1967pub struct LvmScroll {
1972 pub horizontal: i32,
1973 pub vertical: i32,
1974}
1975
1976impl MsgSend for LvmScroll {
1977 type RetType = SysResult<()>;
1978
1979 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1980 zero_as_badargs(v).map(|_| ())
1981 }
1982
1983 fn as_generic_wm(&mut self) -> Wm {
1984 Wm {
1985 msg_id: co::LVM::SCROLL.into(),
1986 wparam: self.horizontal as _,
1987 lparam: self.vertical as _,
1988 }
1989 }
1990}
1991
1992pub struct LvmSetBkColor {
1997 pub color: Option<COLORREF>,
1998}
1999
2000impl MsgSend for LvmSetBkColor {
2001 type RetType = SysResult<()>;
2002
2003 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2004 zero_as_badargs(v).map(|_| ())
2005 }
2006
2007 fn as_generic_wm(&mut self) -> Wm {
2008 Wm {
2009 msg_id: co::LVM::SETBKCOLOR.into(),
2010 wparam: 0,
2011 lparam: self.color.map_or(co::CLR::NONE.raw(), |c| c.raw()) as _,
2012 }
2013 }
2014}
2015
2016pub struct LvmSetBkImage<'a, 'b> {
2021 pub lvbkimage: &'b LVBKIMAGE<'a>,
2022}
2023
2024impl<'a, 'b> MsgSend for LvmSetBkImage<'a, 'b> {
2025 type RetType = SysResult<()>;
2026
2027 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2028 zero_as_badargs(v).map(|_| ())
2029 }
2030
2031 fn as_generic_wm(&mut self) -> Wm {
2032 Wm {
2033 msg_id: co::LVM::SETBKIMAGE.into(),
2034 wparam: 0,
2035 lparam: self.lvbkimage as *const _ as _,
2036 }
2037 }
2038}
2039
2040pub struct LvmSetCallbackMask {
2045 pub mask: co::LVIS,
2046}
2047
2048impl MsgSend for LvmSetCallbackMask {
2049 type RetType = SysResult<()>;
2050
2051 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2052 zero_as_badargs(v).map(|_| ())
2053 }
2054
2055 fn as_generic_wm(&mut self) -> Wm {
2056 Wm {
2057 msg_id: co::LVM::SETCALLBACKMASK.into(),
2058 wparam: self.mask.raw() as _,
2059 lparam: 0,
2060 }
2061 }
2062}
2063
2064pub struct LvmSetColumn<'a, 'b> {
2069 pub index: u32,
2070 pub lvcolumn: &'b LVCOLUMN<'a>,
2071}
2072
2073impl<'a, 'b> MsgSend for LvmSetColumn<'a, 'b> {
2074 type RetType = SysResult<()>;
2075
2076 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2077 zero_as_badargs(v).map(|_| ())
2078 }
2079
2080 fn as_generic_wm(&mut self) -> Wm {
2081 Wm {
2082 msg_id: co::LVM::SETCOLUMN.into(),
2083 wparam: self.index as _,
2084 lparam: self.lvcolumn as *const _ as _,
2085 }
2086 }
2087}
2088
2089pub struct LvmSetColumnOrderArray<'a> {
2094 pub order: &'a [u32],
2095}
2096
2097impl<'a> MsgSend for LvmSetColumnOrderArray<'a> {
2098 type RetType = SysResult<()>;
2099
2100 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2101 zero_as_badargs(v).map(|_| ())
2102 }
2103
2104 fn as_generic_wm(&mut self) -> Wm {
2105 Wm {
2106 msg_id: co::LVM::SETCOLUMNORDERARRAY.into(),
2107 wparam: self.order.len() as _,
2108 lparam: vec_ptr(self.order) as _,
2109 }
2110 }
2111}
2112
2113pub struct LvmSetColumnWidth {
2118 pub index: u32,
2119 pub width: u32,
2120}
2121
2122impl MsgSend for LvmSetColumnWidth {
2123 type RetType = SysResult<()>;
2124
2125 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2126 zero_as_badargs(v).map(|_| ())
2127 }
2128
2129 fn as_generic_wm(&mut self) -> Wm {
2130 Wm {
2131 msg_id: co::LVM::SETCOLUMNWIDTH.into(),
2132 wparam: self.index as _,
2133 lparam: self.width as _,
2134 }
2135 }
2136}
2137
2138pub struct LvmSetExtendedListViewStyle {
2143 pub style: co::LVS_EX,
2144 pub mask: co::LVS_EX,
2145}
2146
2147impl MsgSend for LvmSetExtendedListViewStyle {
2148 type RetType = co::LVS_EX;
2149
2150 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2151 unsafe { co::LVS_EX::from_raw(v as _) }
2152 }
2153
2154 fn as_generic_wm(&mut self) -> Wm {
2155 Wm {
2156 msg_id: co::LVM::SETEXTENDEDLISTVIEWSTYLE.into(),
2157 wparam: self.style.raw() as _,
2158 lparam: self.mask.raw() as _,
2159 }
2160 }
2161}
2162
2163pub struct LvmSetGroupInfo<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> {
2168 pub id: u32,
2169 pub info: &'h LVGROUP<'a, 'b, 'c, 'd, 'e, 'f, 'g>,
2170}
2171
2172impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> MsgSend for LvmSetGroupInfo<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> {
2173 type RetType = SysResult<u32>;
2174
2175 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2176 minus1_as_badargs(v).map(|v| v as _)
2177 }
2178
2179 fn as_generic_wm(&mut self) -> Wm {
2180 Wm {
2181 msg_id: co::LVM::SETGROUPINFO.into(),
2182 wparam: self.id as _,
2183 lparam: self.info as *const _ as _,
2184 }
2185 }
2186}
2187
2188pub struct LvmSetGroupMetrics<'a> {
2193 pub info: &'a LVGROUPMETRICS,
2194}
2195
2196impl<'a> MsgSend for LvmSetGroupMetrics<'a> {
2197 type RetType = ();
2198
2199 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
2200 ()
2201 }
2202
2203 fn as_generic_wm(&mut self) -> Wm {
2204 Wm {
2205 msg_id: co::LVM::SETGROUPMETRICS.into(),
2206 wparam: 0,
2207 lparam: self.info as *const _ as _,
2208 }
2209 }
2210}
2211
2212pub struct LvmSetHotCursor<'a> {
2217 pub hcursor: Option<&'a HCURSOR>,
2218}
2219
2220impl<'a> MsgSend for LvmSetHotCursor<'a> {
2221 type RetType = Option<HCURSOR>;
2222
2223 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2224 zero_as_none(v).map(|p| unsafe { HCURSOR::from_ptr(p as _) })
2225 }
2226
2227 fn as_generic_wm(&mut self) -> Wm {
2228 Wm {
2229 msg_id: co::LVM::SETHOTCURSOR.into(),
2230 wparam: 0,
2231 lparam: self.hcursor.map_or(0, |h| h.ptr() as _),
2232 }
2233 }
2234}
2235
2236pub struct LvmSetHotItem {
2241 pub index: Option<u32>,
2242}
2243
2244impl MsgSend for LvmSetHotItem {
2245 type RetType = Option<u32>;
2246
2247 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2248 minus1_as_none(v).map(|v| v as _)
2249 }
2250
2251 fn as_generic_wm(&mut self) -> Wm {
2252 Wm {
2253 msg_id: co::LVM::SETHOTITEM.into(),
2254 wparam: self.index.unwrap_or(0) as _,
2255 lparam: 0,
2256 }
2257 }
2258}
2259
2260pub struct LvmSetHoverTime {
2265 pub ms: Option<u32>,
2266}
2267
2268impl MsgSend for LvmSetHoverTime {
2269 type RetType = Option<u32>;
2270
2271 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2272 minus1_as_none(v).map(|v| v as _)
2273 }
2274
2275 fn as_generic_wm(&mut self) -> Wm {
2276 Wm {
2277 msg_id: co::LVM::SETHOVERTIME.into(),
2278 wparam: self.ms.map_or(-1, |ms| ms as i32) as _,
2279 lparam: 0,
2280 }
2281 }
2282}
2283
2284pub struct LvmSetIconSpacing {
2289 pub size: SIZE,
2290}
2291
2292impl MsgSend for LvmSetIconSpacing {
2293 type RetType = SIZE;
2294
2295 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2296 SIZE::from(v as u32)
2297 }
2298
2299 fn as_generic_wm(&mut self) -> Wm {
2300 Wm {
2301 msg_id: co::LVM::SETICONSPACING.into(),
2302 wparam: 0,
2303 lparam: u32::from(self.size) as _,
2304 }
2305 }
2306}
2307
2308pub struct LvmSetImageList {
2313 pub kind: co::LVSIL,
2314 pub himagelist: Option<HIMAGELIST>,
2315}
2316
2317impl MsgSend for LvmSetImageList {
2318 type RetType = Option<HIMAGELIST>;
2319
2320 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2321 zero_as_none(v).map(|p| unsafe { HIMAGELIST::from_ptr(p as _) })
2322 }
2323
2324 fn as_generic_wm(&mut self) -> Wm {
2325 Wm {
2326 msg_id: co::LVM::SETIMAGELIST.into(),
2327 wparam: self.kind.raw() as _,
2328 lparam: self.himagelist.as_ref().map_or(0, |h| h.ptr() as _),
2329 }
2330 }
2331}
2332
2333pub struct LvmSetInfoTip<'a, 'b> {
2338 pub info: &'b LVSETINFOTIP<'a>,
2339}
2340
2341impl<'a, 'b> MsgSend for LvmSetInfoTip<'a, 'b> {
2342 type RetType = SysResult<()>;
2343
2344 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2345 zero_as_badargs(v).map(|_| ())
2346 }
2347
2348 fn as_generic_wm(&mut self) -> Wm {
2349 Wm {
2350 msg_id: co::LVM::SETINFOTIP.into(),
2351 wparam: 0,
2352 lparam: self.info as *const _ as _,
2353 }
2354 }
2355}
2356
2357pub struct LvmSetInsertMark<'a> {
2362 pub info: &'a LVINSERTMARK,
2363}
2364
2365impl<'a> MsgSend for LvmSetInsertMark<'a> {
2366 type RetType = SysResult<()>;
2367
2368 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2369 zero_as_badargs(v).map(|_| ())
2370 }
2371
2372 fn as_generic_wm(&mut self) -> Wm {
2373 Wm {
2374 msg_id: co::LVM::SETINSERTMARK.into(),
2375 wparam: 0,
2376 lparam: self.info as *const _ as _,
2377 }
2378 }
2379}
2380
2381pub struct LvmSetInsertMarkColor {
2386 pub color: COLORREF,
2387}
2388
2389impl MsgSend for LvmSetInsertMarkColor {
2390 type RetType = COLORREF;
2391
2392 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2393 unsafe { COLORREF::from_raw(v as _) }
2394 }
2395
2396 fn as_generic_wm(&mut self) -> Wm {
2397 Wm {
2398 msg_id: co::LVM::SETINSERTMARKCOLOR.into(),
2399 wparam: 0,
2400 lparam: u32::from(self.color) as _,
2401 }
2402 }
2403}
2404
2405pub struct LvmSetItem<'a, 'b> {
2410 pub lvitem: &'b LVITEM<'a>,
2411}
2412
2413impl<'a, 'b> MsgSend for LvmSetItem<'a, 'b> {
2414 type RetType = SysResult<()>;
2415
2416 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2417 zero_as_badargs(v).map(|_| ())
2418 }
2419
2420 fn as_generic_wm(&mut self) -> Wm {
2421 Wm {
2422 msg_id: co::LVM::SETITEM.into(),
2423 wparam: 0,
2424 lparam: self.lvitem as *const _ as _,
2425 }
2426 }
2427}
2428
2429pub struct LvmSetItemCount {
2434 pub count: u32,
2435 pub behavior: Option<co::LVSICF>,
2436}
2437
2438impl MsgSend for LvmSetItemCount {
2439 type RetType = SysResult<()>;
2440
2441 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2442 zero_as_badargs(v).map(|_| ())
2443 }
2444
2445 fn as_generic_wm(&mut self) -> Wm {
2446 Wm {
2447 msg_id: co::LVM::SETITEMCOUNT.into(),
2448 wparam: self.count as _,
2449 lparam: self.behavior.unwrap_or_default().raw() as _,
2450 }
2451 }
2452}
2453
2454pub struct LvmSetItemIndexState<'a, 'b, 'c> {
2459 pub lvitemindex: &'a LVITEMINDEX,
2460 pub lvitem: &'c LVITEM<'b>,
2461}
2462
2463impl<'a, 'b, 'c> MsgSend for LvmSetItemIndexState<'a, 'b, 'c> {
2464 type RetType = HrResult<()>;
2465
2466 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2467 HrRet(v as _).to_hrresult()
2468 }
2469
2470 fn as_generic_wm(&mut self) -> Wm {
2471 Wm {
2472 msg_id: co::LVM::SETITEMINDEXSTATE.into(),
2473 wparam: self.lvitemindex as *const _ as _,
2474 lparam: self.lvitem as *const _ as _,
2475 }
2476 }
2477}
2478
2479pub struct LvmSetItemPosition {
2484 pub index: u32,
2485 pub position: POINT,
2486}
2487
2488impl MsgSend for LvmSetItemPosition {
2489 type RetType = SysResult<()>;
2490
2491 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2492 zero_as_badargs(v).map(|_| ())
2493 }
2494
2495 fn as_generic_wm(&mut self) -> Wm {
2496 Wm {
2497 msg_id: co::LVM::SETITEMPOSITION.into(),
2498 wparam: self.index as _,
2499 lparam: u32::from(self.position) as _,
2500 }
2501 }
2502}
2503
2504pub struct LvmSetItemPosition32 {
2509 pub index: u32,
2510 pub position: POINT,
2511}
2512
2513impl MsgSend for LvmSetItemPosition32 {
2514 type RetType = ();
2515
2516 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
2517 ()
2518 }
2519
2520 fn as_generic_wm(&mut self) -> Wm {
2521 Wm {
2522 msg_id: co::LVM::SETITEMPOSITION32.into(),
2523 wparam: self.index as _,
2524 lparam: &self.position as *const _ as _,
2525 }
2526 }
2527}
2528
2529pub struct LvmSetItemState<'a, 'b> {
2534 pub index: Option<u32>,
2535 pub lvitem: &'b LVITEM<'a>,
2536}
2537
2538impl<'a, 'b> MsgSend for LvmSetItemState<'a, 'b> {
2539 type RetType = SysResult<()>;
2540
2541 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2542 zero_as_badargs(v).map(|_| ())
2543 }
2544
2545 fn as_generic_wm(&mut self) -> Wm {
2546 Wm {
2547 msg_id: co::LVM::SETITEMSTATE.into(),
2548 wparam: self.index.map_or(-1, |idx| idx as i32) as _,
2549 lparam: self.lvitem as *const _ as _,
2550 }
2551 }
2552}
2553
2554pub struct LvmSetItemText<'a, 'b> {
2559 pub index: u32,
2560 pub lvitem: &'b LVITEM<'a>,
2561}
2562
2563impl<'a, 'b> MsgSend for LvmSetItemText<'a, 'b> {
2564 type RetType = SysResult<()>;
2565
2566 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2567 zero_as_badargs(v).map(|_| ())
2568 }
2569
2570 fn as_generic_wm(&mut self) -> Wm {
2571 Wm {
2572 msg_id: co::LVM::SETITEMTEXT.into(),
2573 wparam: self.index as _,
2574 lparam: self.lvitem as *const _ as _,
2575 }
2576 }
2577}
2578
2579pub struct LvmSetOutlineColor {
2584 pub color: COLORREF,
2585}
2586
2587impl MsgSend for LvmSetOutlineColor {
2588 type RetType = COLORREF;
2589
2590 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2591 unsafe { COLORREF::from_raw(v as _) }
2592 }
2593
2594 fn as_generic_wm(&mut self) -> Wm {
2595 Wm {
2596 msg_id: co::LVM::SETOUTLINECOLOR.into(),
2597 wparam: 0,
2598 lparam: u32::from(self.color) as _,
2599 }
2600 }
2601}
2602
2603pub struct LvmSetSelectedColumn {
2608 pub index: u32,
2609}
2610
2611impl MsgSend for LvmSetSelectedColumn {
2612 type RetType = ();
2613
2614 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
2615 ()
2616 }
2617
2618 fn as_generic_wm(&mut self) -> Wm {
2619 Wm {
2620 msg_id: co::LVM::SETSELECTEDCOLUMN.into(),
2621 wparam: self.index as _,
2622 lparam: 0,
2623 }
2624 }
2625}
2626
2627pub struct LvmSetSelectionMark {
2632 pub index: Option<u32>,
2633}
2634
2635impl MsgSend for LvmSetSelectionMark {
2636 type RetType = Option<u32>;
2637
2638 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2639 minus1_as_none(v).map(|v| v as _)
2640 }
2641
2642 fn as_generic_wm(&mut self) -> Wm {
2643 Wm {
2644 msg_id: co::LVM::SETSELECTIONMARK.into(),
2645 wparam: 0,
2646 lparam: self.index.map_or(-1, |idx| idx as i32) as _,
2647 }
2648 }
2649}
2650
2651pub struct LvmSetTextBkColor {
2656 pub color: Option<COLORREF>,
2657}
2658
2659impl MsgSend for LvmSetTextBkColor {
2660 type RetType = SysResult<()>;
2661
2662 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2663 zero_as_badargs(v).map(|_| ())
2664 }
2665
2666 fn as_generic_wm(&mut self) -> Wm {
2667 Wm {
2668 msg_id: co::LVM::SETTEXTBKCOLOR.into(),
2669 wparam: 0,
2670 lparam: self.color.map_or(co::CLR::NONE.raw(), |c| c.raw()) as _,
2671 }
2672 }
2673}
2674
2675pub struct LvmSetTextColor {
2680 pub color: Option<COLORREF>,
2681}
2682
2683impl MsgSend for LvmSetTextColor {
2684 type RetType = SysResult<()>;
2685
2686 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2687 zero_as_badargs(v).map(|_| ())
2688 }
2689
2690 fn as_generic_wm(&mut self) -> Wm {
2691 Wm {
2692 msg_id: co::LVM::SETTEXTCOLOR.into(),
2693 wparam: 0,
2694 lparam: self.color.map_or(co::CLR::NONE.raw(), |c| c.raw()) as _,
2695 }
2696 }
2697}
2698
2699pub struct LvmSetTileInfo<'a, 'b> {
2704 pub info: &'b LVTILEINFO<'a>,
2705}
2706
2707impl<'a, 'b> MsgSend for LvmSetTileInfo<'a, 'b> {
2708 type RetType = SysResult<()>;
2709
2710 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2711 zero_as_badargs(v).map(|_| ())
2712 }
2713
2714 fn as_generic_wm(&mut self) -> Wm {
2715 Wm {
2716 msg_id: co::LVM::SETTILEINFO.into(),
2717 wparam: 0,
2718 lparam: self.info as *const _ as _,
2719 }
2720 }
2721}
2722
2723pub struct LvmSetTileViewInfo<'a> {
2728 pub info: &'a LVTILEVIEWINFO,
2729}
2730
2731impl<'a> MsgSend for LvmSetTileViewInfo<'a> {
2732 type RetType = SysResult<()>;
2733
2734 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2735 zero_as_badargs(v).map(|_| ())
2736 }
2737
2738 fn as_generic_wm(&mut self) -> Wm {
2739 Wm {
2740 msg_id: co::LVM::SETTILEVIEWINFO.into(),
2741 wparam: 0,
2742 lparam: self.info as *const _ as _,
2743 }
2744 }
2745}
2746
2747pub struct LvmSetTooltips<'a> {
2752 pub htooltips: Option<&'a HWND>,
2753}
2754
2755impl<'a> MsgSend for LvmSetTooltips<'a> {
2756 type RetType = Option<HWND>;
2757
2758 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2759 zero_as_none(v).map(|p| unsafe { HWND::from_ptr(p as _) })
2760 }
2761
2762 fn as_generic_wm(&mut self) -> Wm {
2763 Wm {
2764 msg_id: co::LVM::SETTOOLTIPS.into(),
2765 wparam: self.htooltips.map_or(0, |h| h.ptr() as _),
2766 lparam: 0,
2767 }
2768 }
2769}
2770
2771pub struct LvmSetUnicodeFormat {
2776 pub use_unicode: bool,
2777}
2778
2779impl MsgSend for LvmSetUnicodeFormat {
2780 type RetType = bool;
2781
2782 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2783 v != 0
2784 }
2785
2786 fn as_generic_wm(&mut self) -> Wm {
2787 Wm {
2788 msg_id: co::LVM::SETUNICODEFORMAT.into(),
2789 wparam: self.use_unicode as _,
2790 lparam: 0,
2791 }
2792 }
2793}
2794
2795pub struct LvmSetView {
2800 pub view: co::LV_VIEW,
2801}
2802
2803impl MsgSend for LvmSetView {
2804 type RetType = SysResult<()>;
2805
2806 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2807 minus1_as_badargs(v).map(|_| ())
2808 }
2809
2810 fn as_generic_wm(&mut self) -> Wm {
2811 Wm {
2812 msg_id: co::LVM::SETVIEW.into(),
2813 wparam: self.view.raw() as _,
2814 lparam: 0,
2815 }
2816 }
2817}
2818
2819pub struct LvmSetWorkAreas<'a> {
2824 pub rects: Option<&'a [RECT]>,
2825}
2826
2827impl<'a> MsgSend for LvmSetWorkAreas<'a> {
2828 type RetType = ();
2829
2830 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
2831 ()
2832 }
2833
2834 fn as_generic_wm(&mut self) -> Wm {
2835 Wm {
2836 msg_id: co::LVM::SETWORKAREAS.into(),
2837 wparam: self.rects.map_or(0, |r| r.len() as _),
2838 lparam: self.rects.map_or(0, |r| vec_ptr(r) as _),
2839 }
2840 }
2841}
2842
2843pub struct LvmSortGroups {
2848 pub callback: Option<PFNLVGROUPCOMPARE>,
2849 pub param: Option<isize>,
2850}
2851
2852impl MsgSend for LvmSortGroups {
2853 type RetType = SysResult<()>;
2854
2855 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2856 zero_as_badargs(v).map(|_| ())
2857 }
2858
2859 fn as_generic_wm(&mut self) -> Wm {
2860 Wm {
2861 msg_id: co::LVM::SORTGROUPS.into(),
2862 wparam: self.callback.map_or(0, |cb| cb as _),
2863 lparam: self.param.unwrap_or(0),
2864 }
2865 }
2866}
2867
2868pub struct LvmSortItems {
2873 pub param: isize,
2874 pub callback: PFNLVCOMPARE,
2875}
2876
2877impl MsgSend for LvmSortItems {
2878 type RetType = SysResult<()>;
2879
2880 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2881 zero_as_badargs(v).map(|_| ())
2882 }
2883
2884 fn as_generic_wm(&mut self) -> Wm {
2885 Wm {
2886 msg_id: co::LVM::SORTITEMS.into(),
2887 wparam: self.param as _,
2888 lparam: self.callback as _,
2889 }
2890 }
2891}
2892
2893pub struct LvmSortItemsEx {
2898 pub param: isize,
2899 pub callback: PFNLVCOMPARE,
2900}
2901
2902impl MsgSend for LvmSortItemsEx {
2903 type RetType = SysResult<()>;
2904
2905 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2906 zero_as_badargs(v).map(|_| ())
2907 }
2908
2909 fn as_generic_wm(&mut self) -> Wm {
2910 Wm {
2911 msg_id: co::LVM::SORTITEMSEX.into(),
2912 wparam: self.param as _,
2913 lparam: self.callback as _,
2914 }
2915 }
2916}
2917
2918pub struct LvmSubItemHitTest<'a> {
2923 pub info: &'a mut LVHITTESTINFO,
2924}
2925
2926impl<'a> MsgSend for LvmSubItemHitTest<'a> {
2927 type RetType = Option<u32>;
2928
2929 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2930 minus1_as_none(v).map(|v| v as _)
2931 }
2932
2933 fn as_generic_wm(&mut self) -> Wm {
2934 Wm {
2935 msg_id: co::LVM::SUBITEMHITTEST.into(),
2936 wparam: -1 as _,
2937 lparam: self.info as *mut _ as _,
2938 }
2939 }
2940}
2941
2942pub struct LvmUpdate {
2947 pub index: u32,
2948}
2949
2950impl MsgSend for LvmUpdate {
2951 type RetType = SysResult<()>;
2952
2953 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2954 zero_as_badargs(v).map(|_| ())
2955 }
2956
2957 fn as_generic_wm(&mut self) -> Wm {
2958 Wm {
2959 msg_id: co::LVM::UPDATE.into(),
2960 wparam: self.index as _,
2961 lparam: 0,
2962 }
2963 }
2964}